package com.skt.domain.VO;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.List;

/**
 * 商家经营统计视图对象（VO）
 * <p>
 * 说明：
 * - 用于返回商家在指定时间范围内的经营数据
 * - 时间范围基于订单创建时间（createdAt）
 */
@Data
@Accessors(chain = true)
@Schema(description = "商家经营统计视图对象")
public class MerchantBusinessStatisticsVO {

    @Schema(description = "统计开始日期（格式：yyyy-MM-dd）", example = "2025-10-01")
    private String startTime;

    @Schema(description = "统计结束日期（格式：yyyy-MM-dd）", example = "2025-10-31")
    private String endTime;

    @Schema(description = "订单总数", example = "120")
    private Long totalOrders;

    @Schema(description = "已完成订单数（状态=已归还）", example = "98")
    private Long completedOrders;

    @Schema(description = "总收入金额（元）", example = "4900.00")
    private BigDecimal totalIncome;

    @Schema(description = "当前在租服装数量（状态为已发货或已取货且未归还）", example = "15")
    private Long rentingCostumeCount;

    @Schema(description = "日均订单量（保留两位小数）", example = "4.00")
    private BigDecimal avgDailyOrders;

    @Schema(description = "日均收入金额（元，保留两位小数）", example = "163.33")
    private BigDecimal avgDailyIncome;

    @Schema(description = "热门服装 TOP5")
    private List<HotCostume> hotCostumes;

    /**
     * 热门服装子对象
     */
    @Data
    @Accessors(chain = true)
    @Schema(description = "热门服装信息")
    public static class HotCostume {
        @Schema(description = "服装ID", example = "1001")
        private Long costumeId;

        @Schema(description = "服装名称", example = "汉服-唐制齐胸")
        private String costumeName;

        @Schema(description = "租赁次数", example = "25")
        private Integer rentalCount;
    }
}